<template>
  <div class="child-left-header">微邮分类</div>
  <div class="content-search-box">
    <je-input
      v-model:value="searchName"
      placeholder="搜索"
      autocomplete="false"
      class="left-search-box"
      @change="handleSearch"
    >
      <template #prefix>
        <i class="fal fa-search" style="padding-right: 2px"></i>
      </template>
    </je-input>
  </div>
  <div class="left-main">
    <div v-for="i in 15" :key="i" class="left-type-item">
      <div class="type-item-name">微邮分类</div>
    </div>
  </div>
</template>

<script>
  import { defineComponent, reactive, toRefs, onBeforeMount, onMounted } from 'vue';
  import VueEvent from '@/helper/event';
  import { HOME_FLOW_SWITCH } from '@/helper/constant';
  import { Input } from '@jecloud/ui';
  export default defineComponent({
    name: 'MicromailType',
    components: {
      JeInput: Input,
    },
    setup() {
      const state = reactive({
        searchName: '',
      });
      const methods = {
        watchFlowType(type) {
          state.curFlowType = type;
        },
        handleSearch() {},
      };
      onBeforeMount(() => {});
      onMounted(() => {
        // VueEvent.on(HOME_FLOW_SWITCH, methods.watchFlowType);
      });
      onMounted(() => {
        // VueEvent.off(HOME_FLOW_SWITCH);
      });

      return {
        ...toRefs(state),
        ...methods,
      };
    },
  });
</script>
<style scoped lang="less">
  .child-left-header {
    width: 210px;
    height: 54px;
    line-height: 54px;
    box-sizing: border-box;
    text-align: center;
    color: #3f3f3f;
    font-size: 16px;
    border-top: 1px solid #f5f5f5;
    border-left: 1px solid #f5f5f5;
    border-bottom: 1px solid #f5f5f5;
  }
  .content-search-box {
    width: 210px;
    height: 40px;
    box-sizing: border-box;
    border-bottom: 1px solid #f5f5f5;
    border-left: 1px solid #f5f5f5;
    padding: 4px 5px;
    .left-search-box {
      width: 200px;
      height: 32px;
      border-radius: 2px;
      background: #f5f5f5;
      font-size: 14px;
      border: 1px solid #f5f5f5;
    }
  }
  .left-main {
    width: 210px;
    height: 600px;
    box-sizing: border-box;
    overflow-y: auto;
    border-left: 1px solid #f5f5f5;
    .left-type-item {
      width: 100%;
      height: 32px;
      padding: 0 20px;
      display: flex;
      align-items: center;
      cursor: pointer;
      .type-item-name {
        font-size: 14px;
        color: #3f3f3f;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
      }
    }
    .left-type-item:hover {
      background: #e4f1ff;
      .type-item-point {
        background-color: #3265f5;
      }
      .type-item-name {
        color: #3265f5;
      }
    }
  }
  .left-main::-webkit-scrollbar {
    width: 0;
    height: 0;
  }
</style>
